<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"  
      xmlns:h="http://java.sun.com/jsf/html"  
      xmlns:f="http://java.sun.com/jsf/core"  
      xmlns:p="http://primefaces.org/ui">  

    <h:head>
        <title>BIENVENIDO</title>
    </h:head>

    <h:body>
        <h:form id="form">
            <p:growl id="messages" showDetail="true"/>  

            <p:toolbar>
                <p:toolbarGroup align="right">
                    <p:commandButton value="Cerrar Sesion" action="index"/>
                </p:toolbarGroup>
                <p:toolbarGroup align="left">
                    <p:commandButton value="volver" action="opciones"/>
                </p:toolbarGroup>
                
            </p:toolbar>
            <br/>

            <p:tabView id="tabView" effect="fade">  

                <p:tab id="tab1" title="Actualizar Horario">  
                    <center> <h1>
                            <h:outputLabel value="ACTUALIZAR HORARIO" style="font-weight: bold"/></h1>
                    </center>
                    <br/>
                    <p:dataTable var="hor" editable="true" editMode="cell" value="#{tableBean.retornarLista()}" >  

                        <f:facet name="header">  
                            HORARIO TECNICO
                        </f:facet>  

                        <p:ajax event="cellEdit"  update=":form:messages" />  

                        <p:column headerText="Hora"  >
                            <h:outputText value="#{hor.hora}" />                            
                        </p:column>  

                        <p:column headerText="Lunes"  >  
                            <p:cellEditor>
                                <f:facet name="output"><h:outputText value="#{hor.lunes}" /></f:facet>  
                                <f:facet name="input"><p:inputText value="#{hor.lunes}" style="width:96%"/></f:facet>
                            </p:cellEditor> 
                        </p:column>  

                        <p:column headerText="Martes"  >  
                            <p:cellEditor>
                                <f:facet name="output"><h:outputText value="#{hor.martes}" /></f:facet>  
                                <f:facet name="input"><p:inputText value="#{hor.martes}" style="width:96%"/></f:facet>
                            </p:cellEditor>
                        </p:column>  

                        <p:column headerText="Miercoles"  >  
                            <p:cellEditor>
                                <f:facet name="output"><h:outputText value="#{hor.miercles}" /></f:facet>  
                                <f:facet name="input"><p:inputText value="#{hor.miercles}" style="width:96%"/></f:facet>
                            </p:cellEditor>
                        </p:column>

                        <p:column headerText="Jueves"  >  
                            <p:cellEditor>
                                <f:facet name="output"><h:outputText value="#{hor.jueves}" /></f:facet>  
                                <f:facet name="input"><p:inputText value="#{hor.jueves}" style="width:96%"/></f:facet>
                            </p:cellEditor>
                        </p:column> 

                        <p:column headerText="Viernes"  >  
                            <p:cellEditor>
                                <f:facet name="output"><h:outputText value="#{hor.viernes}" /></f:facet>  
                                <f:facet name="input"><p:inputText value="#{hor.viernes}" style="width:96%"/></f:facet>
                            </p:cellEditor> 
                        </p:column> 

                        <p:column headerText="Sabado"  >  
                            <p:cellEditor>
                                <f:facet name="output"><h:outputText value="#{hor.sabado}" /></f:facet>  
                                <f:facet name="input"><p:inputText value="#{hor.sabado}" style="width:96%"/></f:facet>
                            </p:cellEditor>
                        </p:column> 

                    </p:dataTable>
                    <br/><br/>
                    <center><p:commandButton value="Guardar" actionListener="#{horarioBean.mostrar()}"/></center>

                </p:tab>  

                <p:tab id="tab2" title="Ver Horario Tecnico">  
                    <center><h1><h:outputLabel value="CONSULTAR HORARIO TECNICO" style="font-weight: bold"/>
                        </h1></center>

                    <p:panelGrid columns="3">
                        <h:outputText value="Ingrese codigo: "/>
                        <h:inputText />
                        <p:commandButton value="Buscar Horario"/>

                    </p:panelGrid>


                    
                    <h3>HORARIO TECNICO</h3>  
                    <p:dataList value="#{horarioBean.retornarLista()}" var="lista" type="ordered">  
                        #{lista.dia}, #{lista.hora}  
                    </p:dataList>


                </p:tab>  



            </p:tabView>  

        </h:form>
    </h:body>





</html>
